/*
 * DrawableInterface.h
 *
 *  Created on: Jul 1, 2009
 *      Author: kurt
 */

#ifndef DRAWABLEINTERFACE_H_
#define DRAWABLEINTERFACE_H_

#include "Object.h"
#include "Color.h"
#include "Location.h"

namespace objdraw
{

class DrawingCanvas;
class DrawableInterface: public objdraw::Object 
{
	protected:
		friend class CanvasManager;
		
		DrawingCanvas * canvas;
		Color color;
		Location start;
		bool hidden;
		
		virtual ~DrawableInterface();
	public:
		virtual inline void Delete() { if(canvas == NULL) delete this; }
		
		DrawableInterface();
		DrawableInterface(DrawableInterface const & r);
		virtual bool operator==(DrawableInterface d);
		
		virtual void addToCanvas(DrawingCanvas * c);
		
		virtual bool contains(Location point);
		
		virtual DrawingCanvas * getCanvas();
		
		virtual Color getColor();
		virtual void setColor(Color c);
		
		virtual void hide();
		virtual void show();
		virtual bool isHidden();
		
		virtual void move(float dx, float dy);
		virtual void moveTo(float x, float y);
		virtual void moveTo(Location point);
		
		virtual void removeFromCanvas();
		virtual void sendBackward();
		virtual void sendForward();
		virtual void sendToBack();
		virtual void sendToFront();
		
		virtual void render();
		inline void draw() { render(); } 
		
		virtual std::string toString();
};

}

#endif /* DRAWABLEINTERFACE_H_ */
